{include file="header.html"}
<script type="text/javascript">
$(function(){
    $('#grade_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
        success       : function(label){
            label.addClass('right').text('OK!');
        },
        onkeyup    : false,
        rules : {
            grade_name : {
                required : true,
                remote   : {
                url :'index.php?app=ugrade&act=check_grade_name',
                type:'get',
                data:{
                        grade_name : function(){
                        return $('#grade_name').val();
                        },
                        id  : '{$ugrade.grade_id}'
                    }
                }
            },
			growth_needed:{
				required : true,
				number   :true,
				min      : 1
			}
        },
        messages : {
            grade_name : {
                required : '{$lang.level_name_required}',
                remote   : '{$lang.level_name_remote}'
            },
			growth_needed:{
				required :'{$lang.growth_point_required}',
				number   :'{$lang.growth_point_number}',
				min      :'{$lang.growth_point_min}'
			}
        }
    });
});
</script>
<div id="rightTop">
  <ul class="subnav">
    <li><a class="btn1" href="index.php?app=ugrade">{$lang.level_manage}</a></li>
    <li>
      {if $smarty.get.act eq 'edit'}
      <span>{$lang.edit_level}</span>
      {else}
      <span>{$lang.add_level}</span>
      {/if}
    </li>
  </ul>
</div>
<div class="info">
  <form method="post" enctype="multipart/form-data" id="grade_form">
    <table class="infoTable">
      <tr>
        <th class="paddingT15"> {$lang.grade_name}:</th>
        <td class="paddingT15 wordSpacing5"><input class="infoTableInput2" name="grade_name" type="text" id="grade_name" value="{$ugrade.grade_name}" /> </td>
      </tr>
       <tr>
        <th class="paddingT15"> {$lang.grade_icon}:</th>
        <td class="paddingT15 wordSpacing5"><input type="file" name="grade_icon" value="{$real_site_url}/{$ugrade.grade_icon}" /></td>
      </tr>
      <!--{if $ugrade.grade_icon}-->
      <tr>
        <th class="paddingT15"></th>
        <td class="paddingT15 wordSpacing5"><img width="" height="" src="{$real_site_url}/{$ugrade.grade_icon}" /></td>
      </tr>
      <!--{/if}--> 
      <tr>
        <th class="paddingT15"> {$lang.grade}:</th>
        <td><!--{if $smarty.get.act eq 'edit'}-->{$ugrade.grade}<!--{else}-->{$ugrade}<!--{/if}--><input class="infoTableInput2" name="grade" type="hidden"  value="{$ugrade}" /></td>
      </tr>
      <!--{if $ugrade.grade_id neq 1}-->
      <tr>
        <th class="paddingT15"> {$lang.growth_needed}:</th>
        <td class="paddingT15 wordSpacing5"><input class="infoTableInput2" name="growth_needed" type="text" id="growth_needed" value="{$ugrade.growth_needed}" /><span class="gray field_notice">{$lang.growth_needed_desc}</span></td>
      </tr>
      <!--{/if}--> 
      <tr>
        <th></th>
        <td class="ptb20"><input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
          <input class="formbtn" type="reset" name="Reset" value="{$lang.reset}" />        </td>
      </tr>
    </table>
  </form>
</div>
{include file="footer.html"}